package com.youchu.pattern.design.behavioral.chain.handler;

import com.youchu.pattern.design.behavioral.chain.entity.User;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

// 具体处理器 - 验证密码强度
@Component
@Order(200)
public class PasswordRegisterHandler extends AbstractRegisterHandler {
    public void handleRequest(User user) {
        if (user.getPassword() == null || user.getPassword().length() < 8) {
            throw new RuntimeException("密码长度不能少于8位");

        }
        next.handleRequest(user);
    }
}